/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.its.dsw2.veterinarySystem.bl;

import java.util.ArrayList;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import mx.its.dsw2.veterinarySystem.dao.DetalleExamenDaoLocal;
import mx.its.dsw2.veterinarySystem.enumeraciones.TransactionStatus;
import mx.its.dsw2.veterinarySystem.modelo.DetalleExamen;
import mx.its.dsw2.veterinarySystem.modelo.Examen;

/**
 *
 * @author 100101
 */
@Stateless
public class DetalleExamenBl implements DetalleExamenBlLocal {
    @EJB
    private DetalleExamenDaoLocal detalleExamenDao;

    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")

    @Override
    public TransactionStatus register(DetalleExamen detailedExamination) {
        detalleExamenDao.create(detailedExamination);
        return TransactionStatus.REALIZED;
    }

    @Override
    public TransactionStatus modify(DetalleExamen detailedExamination) {
        detalleExamenDao.edit(detailedExamination);
        return TransactionStatus.REALIZED;
    }

    @Override
    public List<DetalleExamen> getAll() {
        return detalleExamenDao.findAll();
    }

    @Override
    public List<DetalleExamen> getListByExamen(Examen exam) {
        List<DetalleExamen> lista=detalleExamenDao.getListByExam(exam);
//         List<DetalleExamen> listaFinal=new ArrayList<DetalleExamen>();
//         for(DetalleExamen cdl:lista){//checar se pierde el valor
//             listaFinal.add(cdl.);
//         }
         return lista;
        
    }
    
    
    
}
